# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidPublisher.V3.Model.DeviceSelector do
  @moduledoc """
  Selector for a device group. A selector consists of a set of conditions on the device that should all match (logical AND) to determine a device group eligibility. For instance, if a selector specifies RAM conditions, device model inclusion and device model exclusion, a device is considered to match if: device matches RAM conditions AND device matches one of the included device models AND device doesn't match excluded device models

  ## Attributes

  *   `deviceRam` (*type:* `GoogleApi.AndroidPublisher.V3.Model.DeviceRam.t`, *default:* `nil`) - Conditions on the device's RAM.
  *   `excludedDeviceIds` (*type:* `list(GoogleApi.AndroidPublisher.V3.Model.DeviceId.t)`, *default:* `nil`) - Device models excluded by this selector, even if they match all other conditions.
  *   `forbiddenSystemFeatures` (*type:* `list(GoogleApi.AndroidPublisher.V3.Model.SystemFeature.t)`, *default:* `nil`) - A device that has any of these system features is excluded by this selector, even if it matches all other conditions.
  *   `includedDeviceIds` (*type:* `list(GoogleApi.AndroidPublisher.V3.Model.DeviceId.t)`, *default:* `nil`) - Device models included by this selector.
  *   `requiredSystemFeatures` (*type:* `list(GoogleApi.AndroidPublisher.V3.Model.SystemFeature.t)`, *default:* `nil`) - A device needs to have all these system features to be included by the selector.
  *   `systemOnChips` (*type:* `list(GoogleApi.AndroidPublisher.V3.Model.SystemOnChip.t)`, *default:* `nil`) - Optional. The SoCs included by this selector. Only works for Android S+ devices.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :deviceRam => GoogleApi.AndroidPublisher.V3.Model.DeviceRam.t() | nil,
          :excludedDeviceIds => list(GoogleApi.AndroidPublisher.V3.Model.DeviceId.t()) | nil,
          :forbiddenSystemFeatures =>
            list(GoogleApi.AndroidPublisher.V3.Model.SystemFeature.t()) | nil,
          :includedDeviceIds => list(GoogleApi.AndroidPublisher.V3.Model.DeviceId.t()) | nil,
          :requiredSystemFeatures =>
            list(GoogleApi.AndroidPublisher.V3.Model.SystemFeature.t()) | nil,
          :systemOnChips => list(GoogleApi.AndroidPublisher.V3.Model.SystemOnChip.t()) | nil
        }

  field(:deviceRam, as: GoogleApi.AndroidPublisher.V3.Model.DeviceRam)
  field(:excludedDeviceIds, as: GoogleApi.AndroidPublisher.V3.Model.DeviceId, type: :list)

  field(:forbiddenSystemFeatures,
    as: GoogleApi.AndroidPublisher.V3.Model.SystemFeature,
    type: :list
  )

  field(:includedDeviceIds, as: GoogleApi.AndroidPublisher.V3.Model.DeviceId, type: :list)

  field(:requiredSystemFeatures,
    as: GoogleApi.AndroidPublisher.V3.Model.SystemFeature,
    type: :list
  )

  field(:systemOnChips, as: GoogleApi.AndroidPublisher.V3.Model.SystemOnChip, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidPublisher.V3.Model.DeviceSelector do
  def decode(value, options) do
    GoogleApi.AndroidPublisher.V3.Model.DeviceSelector.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidPublisher.V3.Model.DeviceSelector do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
